﻿using System;
using System.Collections.Generic;
using TSites.GUI.Enums;

namespace TSites.GUI
{
	public class Immanuelnfo
	{
		public string VNName { get; set; }
		public string ENName { get; set; }
		public string RepresentedBy { get; set; }
		public string VNPosition { get; set; }
		public string ENPosition { get; set; }
		public string AuthorizationNo { get; set; }
		public DateTime AuthorizationDate { get; set; }
		public string TelephoneNo { get; set; }
		public string Fax { get; set; }
		public string VNAddress { get; set; }
		public string ENAddress { get; set; }
		public string Beneficiary { get; set; }
		public string BankAccount { get; set; }
		public string BankVNAccountAt { get; set; }
		public string BankENAccountAt { get; set; }
		public string TaxCode { get; set; }

		public void AddBookMarks(Dictionary<string, object> bookmarkHash, LANGUAGE language)
		{
			bookmarkHash = bookmarkHash ?? new Dictionary<string, object>();

			string prefix = "Immanuel";
			string name, representedBy, position, authorizationNo, authorizationDate, telephoneNo,
				fax, address, beneficiary, bankAccount, bankAccountAt, taxCode;

			representedBy = RepresentedBy;
			authorizationNo = AuthorizationNo;
			telephoneNo = TelephoneNo;
			fax = Fax;
			beneficiary = Beneficiary;
			bankAccount = BankAccount;
			taxCode = TaxCode;
			if (language == LANGUAGE.Vietnames)
			{
				name = VNName;
				position = VNPosition;
				authorizationDate = GlobalConst.VNFormatDate(AuthorizationDate);
				address = VNAddress;
				bankAccountAt = BankVNAccountAt;
			}
			else
			{
				name = ENName;
				position = ENPosition;
				authorizationDate = AuthorizationDate.ToString(GlobalConst.EN_FORMAT_DATE);
				address = ENAddress;
				bankAccountAt = BankENAccountAt;
			}

			// add to hash
			bookmarkHash.Add(prefix + "Name", name);
			bookmarkHash.Add(prefix + "Name1", name);
			bookmarkHash.Add(prefix + "Name2", name);

			bookmarkHash.Add(prefix + "RepresentedBy", representedBy);
			bookmarkHash.Add(prefix + "RepresentedBy1", representedBy);

			bookmarkHash.Add(prefix + "Position", position);
			bookmarkHash.Add(prefix + "Position1", position);

			bookmarkHash.Add(prefix + "AuthorizationNo", authorizationNo);
			bookmarkHash.Add(prefix + "AuthorizationDate", authorizationDate);
			bookmarkHash.Add(prefix + "TelephoneNo", telephoneNo);
			bookmarkHash.Add(prefix + "Fax", fax);
			bookmarkHash.Add(prefix + "Address", address);
			bookmarkHash.Add(prefix + "Beneficiary", beneficiary);
			bookmarkHash.Add(prefix + "BankAccount", bankAccount);
			bookmarkHash.Add(prefix + "BankAccountAt", bankAccountAt);
			bookmarkHash.Add(prefix + "TaxCode", taxCode);
		}
	}
}
